\subsubsection{Linux}

Here is how a thread-local global variable is declared in GCC:

\begin{lstlisting}
__thread uint32_t rand_state=1234;
\end{lstlisting}

This is not the standard \CCpp modifier, but a rather GCC-specific one
\footnote{\url{http://go.yurichev.com/17062}}.

\myindex{x86!\Registers!GS}

The \TT{GS:} selector is also used to access the \ac{TLS}, but in a somewhat different way:

\lstinputlisting[caption=\Optimizing GCC 4.8.1 x86,style=customasmx86]{OS/TLS/linux/rand.lst}

% FIXME (to be checked) Uninitialized data is allocated in \TT{.tbss} section, initialized --- in \TT{.tdata} section.

More about it: \DrepperTLS.

